package com.online.music.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.online.music.entity.po.Lyrics;
import com.online.music.mapper.LyricsMapper;
import com.online.music.service.ILyricsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;

import java.util.List;

import com.online.music.common.Result;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: Leno
 * @Date: 2025-01-31
 * @Description: LyricsServiceImpl
 */
@Service
@RequiredArgsConstructor
public class LyricsServiceImpl extends ServiceImpl<LyricsMapper, Lyrics> implements ILyricsService {

    private final LyricsMapper lyricsMapper;

    @Override
    public Result<Page<Lyrics>> findPage(Integer pageNum, Integer pageSize, Lyrics lyrics) {
        Page<Lyrics> page = new Page<>(pageNum, pageSize);
        LambdaQueryWrapper<Lyrics> lqw = new LambdaQueryWrapper<>();
        // 添加条件...

        return Result.success(page(page, lqw));
    }

    @Override
    @Transactional
    public Result<String> deleteBatch(List<Long> ids) {
        // 删除前先判断是否存在...
        removeByIds(ids);
        return Result.successMsg("删除成功");
    }

}

